<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'basic';
$return=array();
/*******basic*******/
if($_RQ['op']=='basic'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		if(!$postdata['user_name'] || !$postdata['cert_no']){
			exi('姓名，身份证号必填！','error');
		}
		$res=$this->model('model')->person_check($postdata);
		exi('认证标识：'.$res['certifyId'].',认证流程入口 URL：'.$res['certifyUrl']);
	}
	$return['item']=$this->plugin_setting('basic');
	$htmls=array(
		'type'=>'edit',
		'desc'=>'实人认证接口测试',
		'edit_tab'=>true,
		'edits'=>array(
			array(
				'title'=>'实人认证接口测试',
				'list'=>array(
					array('type'=>'tip','title'=>'<red>PHP必须7.2以上</red>
					</br>蚂蚁链租赁平台：https://antchain.antgroup.com/docs/11/190768
					</br>API文档：https://apdevcenter.antchain.antgroup.com/developer/product/BOT?api=blockchain.bot.lease.realperson.create_1.0
					</br>产品文档：https://antchain.antgroup.com/products
					'),
					array('type'=>'string','title'=>'用户姓名','name'=>'user_name','help'=>'真实姓名'),
					array('type'=>'string','title'=>'用户证件号码','name'=>'cert_no','help'=>'真实身份证'),
				)
			),
		),
	);
	$return['htmls']=$htmls;
	exi($return);
}
